<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
<meta name="google-site-verification" content="SByO7HWUKwufO-witstBrFt-yyK6q3tUlCyYwkvYPiQ" />
<meta name="baidu-site-verification" content="orhaMjPwcS" />
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic|Roboto Slab:300,300italic,400,400italic,700,700italic|Roboto Mono:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"lixiyan4633.gitee.io","root":"/","scheme":"Pisces","version":"7.7.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":true,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="对于Flink来说，watermark是处理事件时间（EventTime）必不可少的概念，本文将从具体实践，来细致了解如何用watermark处理延迟数据。">
<meta property="og:type" content="article">
<meta property="og:title" content="【Flink实战】基于WaterMark的数据延迟处理">
<meta property="og:url" content="https://lixiyan4633.gitee.io/2020/11/06/%E3%80%90Flink%E5%AE%9E%E6%88%98%E3%80%91%E5%9F%BA%E4%BA%8EWaterMark%E7%9A%84%E6%95%B0%E6%8D%AE%E5%BB%B6%E8%BF%9F%E5%A4%84%E7%90%86/index.html">
<meta property="og:site_name" content="喜延的个人博客">
<meta property="og:description" content="对于Flink来说，watermark是处理事件时间（EventTime）必不可少的概念，本文将从具体实践，来细致了解如何用watermark处理延迟数据。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://tva1.sinaimg.cn/large/0081Kckwly1gkeg4fubogj307k0a8mxg.jpg">
<meta property="og:image" content="https://tva1.sinaimg.cn/large/0081Kckwly1gkeg49ilwyj30hw0axgn1.jpg">
<meta property="og:image" content="https://tva1.sinaimg.cn/large/0081Kckwly1gkf94fkoddj30ms07sweq.jpg">
<meta property="og:image" content="https://tva1.sinaimg.cn/large/0081Kckwly1gkekcge0kcj30ko0gijt2.jpg">
<meta property="og:image" content="https://tva1.sinaimg.cn/large/0081Kckwly1gkf9l6juksj30td09ejrx.jpg">
<meta property="og:image" content="https://tva1.sinaimg.cn/large/0081Kckwly1gkekyuw19hj30kq0as3z9.jpg">
<meta property="og:image" content="https://tva1.sinaimg.cn/large/0081Kckwly1gkel2g3q1vj308a0cagmm.jpg">
<meta property="og:image" content="https://tva1.sinaimg.cn/large/0081Kckwly1gkfa9tn74pj30hx0850t1.jpg">
<meta property="article:published_time" content="2020-11-06T03:40:22.000Z">
<meta property="article:modified_time" content="2020-11-06T03:46:50.161Z">
<meta property="article:author" content="李喜延">
<meta property="article:tag" content="flink">
<meta property="article:tag" content="watermark">
<meta property="article:tag" content="window">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://tva1.sinaimg.cn/large/0081Kckwly1gkeg4fubogj307k0a8mxg.jpg">

<link rel="canonical" href="https://lixiyan4633.gitee.io/2020/11/06/%E3%80%90Flink%E5%AE%9E%E6%88%98%E3%80%91%E5%9F%BA%E4%BA%8EWaterMark%E7%9A%84%E6%95%B0%E6%8D%AE%E5%BB%B6%E8%BF%9F%E5%A4%84%E7%90%86/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true
  };
</script>

  <title>【Flink实战】基于WaterMark的数据延迟处理 | 喜延的个人博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">喜延的个人博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <p class="site-subtitle">我的大数据的之路</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
  </ul>

</nav>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://lixiyan4633.gitee.io/2020/11/06/%E3%80%90Flink%E5%AE%9E%E6%88%98%E3%80%91%E5%9F%BA%E4%BA%8EWaterMark%E7%9A%84%E6%95%B0%E6%8D%AE%E5%BB%B6%E8%BF%9F%E5%A4%84%E7%90%86/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://tva1.sinaimg.cn/large/00831rSTly1gcyel996b4j30oa0oc1kx.jpg">
      <meta itemprop="name" content="李喜延">
      <meta itemprop="description" content="愿世界和平">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="喜延的个人博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          【Flink实战】基于WaterMark的数据延迟处理
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-11-06 11:40:22 / 修改时间：11:46:50" itemprop="dateCreated datePublished" datetime="2020-11-06T11:40:22+08:00">2020-11-06</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Flink/" itemprop="url" rel="index"><span itemprop="name">Flink</span></a>
                </span>
            </span>

          
            <div class="post-description">对于Flink来说，watermark是处理事件时间（EventTime）必不可少的概念，本文将从具体实践，来细致了解如何用watermark处理延迟数据。<br> <img src="https://tva1.sinaimg.cn/large/0081Kckwly1gkfb10e5saj30go0chjrz.jpg"></div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="【Flink实战】基于WaterMark的数据延迟处理"><a href="#【Flink实战】基于WaterMark的数据延迟处理" class="headerlink" title="【Flink实战】基于WaterMark的数据延迟处理"></a>【Flink实战】基于WaterMark的数据延迟处理</h1><h2 id="摘要"><a href="#摘要" class="headerlink" title="摘要"></a>摘要</h2><p>对于Flink来说，watermark是处理事件时间（EventTime）必不可少的概念，本文将从具体实践，来细致了解如何用watermark处理延迟数据。</p>
<h2 id="问题"><a href="#问题" class="headerlink" title="问题"></a>问题</h2><p>关于处理延迟数据，因为迟到事件出现时，窗口已经出现关闭，并产出计算结果，因此常用几个方法有3种：</p>
<ul>
<li>抛弃数据：将迟到数据视为错误数据丢弃。</li>
<li>迟到激活：已经关闭的窗口重新计算，并修正结果。</li>
<li>测流收集：将迟到数据收集起来，另做处理。</li>
</ul>
<p>Flink默认采用第一种方式， 也就是直接丢弃，其他两种分别使用<code>Allowed Lateness</code>和<code>SideOutput</code></p>
<p><strong>SideOutput</strong>: 将迟到事件单独放入一个数据流分支，这会作为window计算的副产品，方便用户做特殊处理；</p>
<p><strong>Allowed Lateness</strong>: 允许用户设置一个最大迟到时长，窗口关闭后会一直保存窗口状态直至超过设置的最大时长，这期间迟到的时间不会被丢弃处理，而是直接触发”已关闭的窗口“的操作。因为保存窗口状态需要额外内存，每次会触发全部的窗口数据计算，代价比较大，所以不宜多，不宜长。</p>
<p>总结一下：</p>
<ul>
<li>窗口window的作用是周期性获取数据</li>
<li>watermark是用来处理数据乱序</li>
<li>allowLateNess 是为了将窗口关闭的时间延迟一段时间</li>
<li>sideOutPut 是用来兜底，窗口彻底关闭，还可以把迟到数据放到侧输出流</li>
</ul>
<h2 id="实战"><a href="#实战" class="headerlink" title="实战"></a>实战</h2><h3 id="0-实战介绍"><a href="#0-实战介绍" class="headerlink" title="0.实战介绍"></a>0.实战介绍</h3><p><strong>数据</strong>： a 1 1000 =&gt; key num time</p>
<p><strong>分隔符</strong>： 空格</p>
<p><strong>窗口</strong>：5s</p>
<p><strong>执行过程</strong>：动态递增输入 1，2，3查询窗口和迟到数据变化。</p>
<h3 id="1-抛弃数据"><a href="#1-抛弃数据" class="headerlink" title="1.抛弃数据"></a>1.抛弃数据</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 延迟数据处理</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@author</span> lixiyan</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@date</span> 2020/11/3 8:27 PM</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">LateDataDemo</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> <span class="keyword">throws</span> Exception </span>&#123;</span><br><span class="line">    <span class="comment">// 基础配置</span></span><br><span class="line">		StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();</span><br><span class="line">		env.setParallelism(<span class="number">1</span>);</span><br><span class="line">		env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime);</span><br><span class="line"></span><br><span class="line">		<span class="comment">// 从socket获取数据  a 1 1000 \n  a 2 2000\n</span></span><br><span class="line">		DataStreamSource&lt;String&gt; stream = env.socketTextStream(<span class="string">"localhost"</span>, <span class="number">12345</span>, <span class="string">'\n'</span>);</span><br><span class="line"></span><br><span class="line">		SingleOutputStreamOperator&lt;String&gt; process = stream.map(<span class="keyword">new</span> MapFunction&lt;String, Tuple3&lt;String, Integer, Long&gt;&gt;() &#123;</span><br><span class="line">			<span class="meta">@Override</span></span><br><span class="line">			<span class="function"><span class="keyword">public</span> Tuple3&lt;String, Integer, Long&gt; <span class="title">map</span><span class="params">(String input)</span> <span class="keyword">throws</span> Exception </span>&#123;</span><br><span class="line">				String[] words = input.split(<span class="string">" "</span>);</span><br><span class="line">				System.out.println(<span class="string">"=====data===="</span> + input);</span><br><span class="line">				<span class="keyword">return</span> <span class="keyword">new</span> Tuple3&lt;String, Integer, Long&gt;(words[<span class="number">0</span>], Integer.valueOf(words[<span class="number">1</span>]), Long.valueOf(words[<span class="number">2</span>]));</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;) <span class="comment">// AssignerWithPeriodicWatermarks 定义周期水印</span></span><br><span class="line">			.assignTimestampsAndWatermarks(<span class="keyword">new</span> AssignerWithPeriodicWatermarks&lt;Tuple3&lt;String, Integer, Long&gt;&gt;() &#123;</span><br><span class="line">			<span class="keyword">long</span> currentTimeStamp = <span class="number">0L</span>;</span><br><span class="line">			<span class="keyword">long</span> maxTimelog = <span class="number">0</span>;</span><br><span class="line">			<span class="keyword">long</span> currentWaterMark;</span><br><span class="line"></span><br><span class="line">			<span class="meta">@Nullable</span></span><br><span class="line">			<span class="meta">@Override</span></span><br><span class="line">			<span class="function"><span class="keyword">public</span> Watermark <span class="title">getCurrentWatermark</span><span class="params">()</span> </span>&#123;</span><br><span class="line">				currentWaterMark = currentTimeStamp - maxTimelog;</span><br><span class="line">				<span class="keyword">return</span> <span class="keyword">new</span> Watermark(currentWaterMark);</span><br><span class="line">			&#125;</span><br><span class="line"></span><br><span class="line">			<span class="meta">@Override</span></span><br><span class="line">			<span class="function"><span class="keyword">public</span> <span class="keyword">long</span> <span class="title">extractTimestamp</span><span class="params">(Tuple3&lt;String, Integer, Long&gt; element, <span class="keyword">long</span> previousElementTimestamp)</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">				currentTimeStamp = Math.max(element.f2, currentTimeStamp);</span><br><span class="line">				System.out.println(<span class="string">"Key:"</span> + element.f0 + <span class="string">",EventTime:"</span> + element.f2 + <span class="string">",水位线:"</span> + currentWaterMark);</span><br><span class="line">				<span class="keyword">return</span> element.f2;</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;).keyBy(<span class="keyword">new</span> KeySelector&lt;Tuple3&lt;String, Integer, Long&gt;, String&gt;() &#123;</span><br><span class="line">			<span class="meta">@Override</span></span><br><span class="line">			<span class="function"><span class="keyword">public</span> String <span class="title">getKey</span><span class="params">(Tuple3&lt;String, Integer, Long&gt; value)</span> <span class="keyword">throws</span> Exception </span>&#123;</span><br><span class="line">				<span class="keyword">return</span> value.f0;</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;).timeWindow(Time.seconds(<span class="number">5</span>)).process(<span class="keyword">new</span> ProcessWindowFunction&lt;Tuple3&lt;String, Integer, Long&gt;, String, String, TimeWindow&gt;() &#123;</span><br><span class="line">			<span class="meta">@Override</span></span><br><span class="line">			<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">process</span><span class="params">(String key, Context ctx, Iterable&lt;Tuple3&lt;String, Integer, Long&gt;&gt; elements, Collector&lt;String&gt; out)</span> <span class="keyword">throws</span> Exception </span>&#123;</span><br><span class="line">				Iterator&lt;Tuple3&lt;String, Integer, Long&gt;&gt; iterator = elements.iterator();</span><br><span class="line">				Integer sum = <span class="number">0</span>;</span><br><span class="line">				<span class="keyword">long</span> currentWatermark = ctx.currentWatermark();</span><br><span class="line">				System.out.println(<span class="string">"======触发窗口计算=====当前水位线："</span> + currentWatermark);</span><br><span class="line">				<span class="keyword">while</span> (iterator.hasNext()) &#123;</span><br><span class="line">					Tuple3&lt;String, Integer, Long&gt; words = iterator.next();</span><br><span class="line">					System.out.println(<span class="string">"窗口数据： "</span> + words);</span><br><span class="line">					sum += words.f1;</span><br><span class="line">				&#125;</span><br><span class="line">				out.collect(<span class="string">"count: "</span> + sum);</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">		env.execute(LateDataDemo<span class="class">.<span class="keyword">class</span>.<span class="title">getSimpleName</span>())</span>;</span><br><span class="line"></span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p><strong>效果展示</strong>：</p>
<p><strong>输入数据：</strong></p>
<p><img src="https://tva1.sinaimg.cn/large/0081Kckwly1gkeg4fubogj307k0a8mxg.jpg" alt="输入数据"></p>
<p><strong>数据输出：</strong></p>
<p><img src="https://tva1.sinaimg.cn/large/0081Kckwly1gkeg49ilwyj30hw0axgn1.jpg" alt="结果输出"></p>
<p><strong>总结</strong>：</p>
<p>由于没设置延迟时间，所以当触发窗口[0,5),当再次传入4的时候，就不会被计算到窗口当中，抛弃了4这条数据。</p>
<p><img src="https://tva1.sinaimg.cn/large/0081Kckwly1gkf94fkoddj30ms07sweq.jpg" alt="效果图"></p>
<h3 id="2-迟到激活"><a href="#2-迟到激活" class="headerlink" title="2.迟到激活"></a>2.迟到激活</h3><p>加上允许迟到3s</p>
<p><code>.timeWindow(Time.seconds(5)).allowedLateness(Time.seconds(3)).process</code></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;**</span><br><span class="line"> * 延迟数据处理</span><br><span class="line"> *</span><br><span class="line"> * @author lixiyan</span><br><span class="line"> * @date 2020&#x2F;11&#x2F;3 8:27 PM</span><br><span class="line"> *&#x2F;</span><br><span class="line">public class LateDataDemo &#123;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">	public static void main(String[] args) throws Exception &#123;</span><br><span class="line"></span><br><span class="line">		StreamExecutionEnvironment env &#x3D; StreamExecutionEnvironment.getExecutionEnvironment();</span><br><span class="line">		env.setParallelism(1);</span><br><span class="line">		env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime);</span><br><span class="line"></span><br><span class="line">		&#x2F;&#x2F; 从socket获取数据  a 1 1000 \n  a 2 2000\n</span><br><span class="line">		DataStreamSource&lt;String&gt; stream &#x3D; env.socketTextStream(&quot;localhost&quot;, 12345, &#39;\n&#39;);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">		SingleOutputStreamOperator&lt;String&gt; process &#x3D; stream.map(new MapFunction&lt;String, Tuple3&lt;String, Integer, Long&gt;&gt;() &#123;</span><br><span class="line">			@Override</span><br><span class="line">			public Tuple3&lt;String, Integer, Long&gt; map(String input) throws Exception &#123;</span><br><span class="line">				String[] words &#x3D; input.split(&quot; &quot;);</span><br><span class="line">				System.out.println(&quot;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;data&#x3D;&#x3D;&#x3D;&#x3D;&quot; + input);</span><br><span class="line">				return new Tuple3&lt;String, Integer, Long&gt;(words[0], Integer.valueOf(words[1]), Long.valueOf(words[2]));</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;) &#x2F;&#x2F; AssignerWithPeriodicWatermarks 定义周期水印</span><br><span class="line">			.assignTimestampsAndWatermarks(new AssignerWithPeriodicWatermarks&lt;Tuple3&lt;String, Integer, Long&gt;&gt;() &#123;</span><br><span class="line">			long currentTimeStamp &#x3D; 0L;</span><br><span class="line">			long maxTimelog &#x3D; 0;</span><br><span class="line">			long currentWaterMark;</span><br><span class="line"></span><br><span class="line">			@Nullable</span><br><span class="line">			@Override</span><br><span class="line">			public Watermark getCurrentWatermark() &#123;</span><br><span class="line">				currentWaterMark &#x3D; currentTimeStamp - maxTimelog;</span><br><span class="line">				return new Watermark(currentWaterMark);</span><br><span class="line">			&#125;</span><br><span class="line"></span><br><span class="line">			@Override</span><br><span class="line">			public long extractTimestamp(Tuple3&lt;String, Integer, Long&gt; element, long previousElementTimestamp) &#123;</span><br><span class="line"></span><br><span class="line">				currentTimeStamp &#x3D; Math.max(element.f2, currentTimeStamp);</span><br><span class="line">				System.out.println(&quot;Key:&quot; + element.f0 + &quot;,EventTime:&quot; + element.f2 + &quot;,水位线:&quot; + currentWaterMark);</span><br><span class="line">				return element.f2;</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;).keyBy(new KeySelector&lt;Tuple3&lt;String, Integer, Long&gt;, String&gt;() &#123;</span><br><span class="line">			@Override</span><br><span class="line">			public String getKey(Tuple3&lt;String, Integer, Long&gt; value) throws Exception &#123;</span><br><span class="line">				return value.f0;</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;).timeWindow(Time.seconds(5)).allowedLateness(Time.seconds(3)).process(new ProcessWindowFunction&lt;Tuple3&lt;String, Integer, Long&gt;, String, String, TimeWindow&gt;() &#123;</span><br><span class="line">			@Override</span><br><span class="line">			public void process(String key, Context ctx, Iterable&lt;Tuple3&lt;String, Integer, Long&gt;&gt; elements, Collector&lt;String&gt; out) throws Exception &#123;</span><br><span class="line">				Iterator&lt;Tuple3&lt;String, Integer, Long&gt;&gt; iterator &#x3D; elements.iterator();</span><br><span class="line">				Integer sum &#x3D; 0;</span><br><span class="line">				long currentWatermark &#x3D; ctx.currentWatermark();</span><br><span class="line">				System.out.println(&quot;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;触发窗口计算&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;当前水位线：&quot; + currentWatermark);</span><br><span class="line">				while (iterator.hasNext()) &#123;</span><br><span class="line">					Tuple3&lt;String, Integer, Long&gt; words &#x3D; iterator.next();</span><br><span class="line">					System.out.println(&quot;窗口数据： &quot; + words);</span><br><span class="line">					sum +&#x3D; words.f1;</span><br><span class="line">				&#125;</span><br><span class="line">				out.collect(&quot;count: &quot; + sum);</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;);</span><br><span class="line">		env.execute(LateDataDemo.class.getSimpleName());</span><br><span class="line"></span><br><span class="line">	&#125;</span><br></pre></td></tr></table></figure>

<p><img src="https://tva1.sinaimg.cn/large/0081Kckwly1gkekcge0kcj30ko0gijt2.jpg" alt=""></p>
<p>总结：</p>
<p>迟到激活：是指下一个窗口已经触发(输入5s)，上个窗口关闭，但是在允许迟到的区间内 [5,8)，输入迟到数据（输入4s），会激活上个窗口，并将上个窗口所有数据 遍历一次，并计算输出。当超过允许迟到 &gt;8s，就会彻底关闭上个窗口，再次输入迟到数据（2和1）就会视为迟到数据，丢弃。</p>
<p>![效果](<a href="https://tva1.sinaimg.cn/large/0081Kckwly1gkekcvk3i5j30ay0ibq4f.jpg" target="_blank" rel="noopener">https://tva1.sinaimg.cn/large/0081Kckwly1gkekcvk3i5j30ay0ibq4f.jpg</a></p>
<p><img src="https://tva1.sinaimg.cn/large/0081Kckwly1gkf9l6juksj30td09ejrx.jpg" alt="效果"></p>
<h3 id="3-测流收集"><a href="#3-测流收集" class="headerlink" title="3.测流收集"></a>3.测流收集</h3><p>迟到数据放到侧输出流；</p>
<p><code>.timeWindow(Time.seconds(5)).sideOutputLateData(lateOutputTag)</code></p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 延迟数据处理</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@author</span> lixiyan</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@date</span> 2020/11/3 8:27 PM</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">LateDataDemo</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span>  OutputTag&lt;Tuple3&lt;String,Integer,Long&gt;&gt; lateOutputTag = <span class="keyword">new</span> OutputTag&lt;Tuple3&lt;String,Integer,Long&gt;&gt;(<span class="string">"rejected"</span>) &#123;&#125;;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> <span class="keyword">throws</span> Exception </span>&#123;</span><br><span class="line"></span><br><span class="line">		StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();</span><br><span class="line">		env.setParallelism(<span class="number">1</span>);</span><br><span class="line">		env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime);</span><br><span class="line"></span><br><span class="line">		<span class="comment">// 从socket获取数据  a 1 1000 \n  a 2 2000\n</span></span><br><span class="line">		DataStreamSource&lt;String&gt; stream = env.socketTextStream(<span class="string">"localhost"</span>, <span class="number">12345</span>, <span class="string">'\n'</span>);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">		SingleOutputStreamOperator&lt;String&gt; process = stream.map(<span class="keyword">new</span> MapFunction&lt;String, Tuple3&lt;String, Integer, Long&gt;&gt;() &#123;</span><br><span class="line">			<span class="meta">@Override</span></span><br><span class="line">			<span class="function"><span class="keyword">public</span> Tuple3&lt;String, Integer, Long&gt; <span class="title">map</span><span class="params">(String input)</span> <span class="keyword">throws</span> Exception </span>&#123;</span><br><span class="line">				String[] words = input.split(<span class="string">" "</span>);</span><br><span class="line">				System.out.println(<span class="string">"=====data===="</span> + input);</span><br><span class="line">				<span class="keyword">return</span> <span class="keyword">new</span> Tuple3&lt;String, Integer, Long&gt;(words[<span class="number">0</span>], Integer.valueOf(words[<span class="number">1</span>]), Long.valueOf(words[<span class="number">2</span>]));</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;) <span class="comment">// AssignerWithPeriodicWatermarks 定义周期水印</span></span><br><span class="line">			.assignTimestampsAndWatermarks(<span class="keyword">new</span> AssignerWithPeriodicWatermarks&lt;Tuple3&lt;String, Integer, Long&gt;&gt;() &#123;</span><br><span class="line">			<span class="keyword">long</span> currentTimeStamp = <span class="number">0L</span>;</span><br><span class="line">			<span class="keyword">long</span> maxTimelog = <span class="number">0</span>;</span><br><span class="line">			<span class="keyword">long</span> currentWaterMark;</span><br><span class="line"></span><br><span class="line">			<span class="meta">@Nullable</span></span><br><span class="line">			<span class="meta">@Override</span></span><br><span class="line">			<span class="function"><span class="keyword">public</span> Watermark <span class="title">getCurrentWatermark</span><span class="params">()</span> </span>&#123;</span><br><span class="line">				currentWaterMark = currentTimeStamp - maxTimelog;</span><br><span class="line">				<span class="keyword">return</span> <span class="keyword">new</span> Watermark(currentWaterMark);</span><br><span class="line">			&#125;</span><br><span class="line"></span><br><span class="line">			<span class="meta">@Override</span></span><br><span class="line">			<span class="function"><span class="keyword">public</span> <span class="keyword">long</span> <span class="title">extractTimestamp</span><span class="params">(Tuple3&lt;String, Integer, Long&gt; element, <span class="keyword">long</span> previousElementTimestamp)</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">				currentTimeStamp = Math.max(element.f2, currentTimeStamp);</span><br><span class="line">				System.out.println(<span class="string">"Key:"</span> + element.f0 + <span class="string">",EventTime:"</span> + element.f2 + <span class="string">",水位线:"</span> + currentWaterMark);</span><br><span class="line">				<span class="keyword">return</span> element.f2;</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;).keyBy(<span class="keyword">new</span> KeySelector&lt;Tuple3&lt;String, Integer, Long&gt;, String&gt;() &#123;</span><br><span class="line">			<span class="meta">@Override</span></span><br><span class="line">			<span class="function"><span class="keyword">public</span> String <span class="title">getKey</span><span class="params">(Tuple3&lt;String, Integer, Long&gt; value)</span> <span class="keyword">throws</span> Exception </span>&#123;</span><br><span class="line">				<span class="keyword">return</span> value.f0;</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;).timeWindow(Time.seconds(<span class="number">5</span>)).sideOutputLateData(lateOutputTag).process(<span class="keyword">new</span> ProcessWindowFunction&lt;Tuple3&lt;String, Integer, Long&gt;, String, String, TimeWindow&gt;() &#123;</span><br><span class="line">			<span class="meta">@Override</span></span><br><span class="line">			<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">process</span><span class="params">(String key, Context ctx, Iterable&lt;Tuple3&lt;String, Integer, Long&gt;&gt; elements, Collector&lt;String&gt; out)</span> <span class="keyword">throws</span> Exception </span>&#123;</span><br><span class="line">				Iterator&lt;Tuple3&lt;String, Integer, Long&gt;&gt; iterator = elements.iterator();</span><br><span class="line">				Integer sum = <span class="number">0</span>;</span><br><span class="line">				<span class="keyword">long</span> currentWatermark = ctx.currentWatermark();</span><br><span class="line">				System.out.println(<span class="string">"======触发窗口计算=====当前水位线："</span> + currentWatermark);</span><br><span class="line">				<span class="keyword">while</span> (iterator.hasNext()) &#123;</span><br><span class="line">					Tuple3&lt;String, Integer, Long&gt; words = iterator.next();</span><br><span class="line">					System.out.println(<span class="string">"窗口数据： "</span> + words);</span><br><span class="line">					sum += words.f1;</span><br><span class="line">				&#125;</span><br><span class="line">				out.collect(<span class="string">"count: "</span> + sum);</span><br><span class="line">			&#125;</span><br><span class="line">		&#125;);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">		DataStream&lt;Tuple3&lt;String, Integer, Long&gt;&gt; sideOutput = process.getSideOutput(lateOutputTag);</span><br><span class="line">		sideOutput.print(<span class="string">"迟到数据==="</span>);</span><br><span class="line"></span><br><span class="line">		env.execute(LateDataDemo<span class="class">.<span class="keyword">class</span>.<span class="title">getSimpleName</span>())</span>;</span><br><span class="line"></span><br><span class="line">	&#125;</span><br></pre></td></tr></table></figure>



<p><img src="https://tva1.sinaimg.cn/large/0081Kckwly1gkekyuw19hj30kq0as3z9.jpg" alt="测流"></p>
<p><img src="https://tva1.sinaimg.cn/large/0081Kckwly1gkel2g3q1vj308a0cagmm.jpg" alt="结果"></p>
<p>总结：</p>
<p>当输入迟到数据时，会把迟到数据放入延迟的窗口输出到指定的OutputTag，方便我们做其他处理。</p>
<p><img src="https://tva1.sinaimg.cn/large/0081Kckwly1gkfa9tn74pj30hx0850t1.jpg" alt="效果"></p>
<h2 id="总结："><a href="#总结：" class="headerlink" title="总结："></a>总结：</h2><p>迟到数据几乎会一直发生在我们的日常操作数据中，处理迟到数据，没有一个严格的标准，要根据数据量，业务考虑来酌情处理迟到数据，可以将上面的几个操作灵活组合，满足我们自己的场景。</p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/flink/" rel="tag"><i class="fa fa-tag"></i> flink</a>
              <a href="/tags/watermark/" rel="tag"><i class="fa fa-tag"></i> watermark</a>
              <a href="/tags/window/" rel="tag"><i class="fa fa-tag"></i> window</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/07/21/%E5%AE%9E%E6%97%B6%E6%95%B0%E4%BB%93-flink-client%E7%9A%84%E5%AE%89%E8%A3%85/" rel="prev" title="实时数仓-flink-client的安装">
      <i class="fa fa-chevron-left"></i> 实时数仓-flink-client的安装
    </a></div>
      <div class="post-nav-item"></div>
    </div>
      </footer>
    
  </article>
  
  
  
<div>
    
    <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">-------------　　　　本文结束　<i class="fa fa-heart"></i>　感谢您的阅读　　　　-------------</div>
    
</div>


    
 </div>

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#【Flink实战】基于WaterMark的数据延迟处理"><span class="nav-number">1.</span> <span class="nav-text">【Flink实战】基于WaterMark的数据延迟处理</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#摘要"><span class="nav-number">1.1.</span> <span class="nav-text">摘要</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#问题"><span class="nav-number">1.2.</span> <span class="nav-text">问题</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#实战"><span class="nav-number">1.3.</span> <span class="nav-text">实战</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#0-实战介绍"><span class="nav-number">1.3.1.</span> <span class="nav-text">0.实战介绍</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-抛弃数据"><span class="nav-number">1.3.2.</span> <span class="nav-text">1.抛弃数据</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-迟到激活"><span class="nav-number">1.3.3.</span> <span class="nav-text">2.迟到激活</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-测流收集"><span class="nav-number">1.3.4.</span> <span class="nav-text">3.测流收集</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#总结："><span class="nav-number">1.4.</span> <span class="nav-text">总结：</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="李喜延"
      src="https://tva1.sinaimg.cn/large/00831rSTly1gcyel996b4j30oa0oc1kx.jpg">
  <p class="site-author-name" itemprop="name">李喜延</p>
  <div class="site-description" itemprop="description">愿世界和平</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">25</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">4</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">25</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">李喜延</span>
</div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
  <script src="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
